import Vue from 'vue';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import ShowOil from './components/oil/show-oil.vue';
import OilNotice from './components/oil/oil-notice.vue';
import Activity from './components/oil/activity.vue';
import axios from 'axios';
import VueCookie from 'vue-cookie'
import 'element-ui/lib/theme-chalk/display.css';
import '../static/theme/index.css';
import '../static/css/style.css'
import {AJAX,URL_OIL_AVATAR} from '@/comm.js'
Vue.prototype.$ajax = axios
Vue.use(ElementUI);
Vue.use(VueCookie);
Vue.config.productionTip = false;
new Vue({
  el: '#app',
  components: { 
  	ShowOil ,
  	OilNotice
  },
  data(){
  	return ({
  		component:''
  	});
  },
  created(){
  	 let This=this;
    //  This.component=OilNotice;
    //  return ;
  	 AJAX({
       method:'get',
       url:URL_OIL_AVATAR
     },function(data){
       if(data.data.data.oilCardNum){
       		This.component=ShowOil;
       }else{
       		This.component=OilNotice;
       }
     });
  },
  methods:{
    change(){
      this.component=Activity;
    }
  }
})
